<template>
  <!-- 清算账户资金池管理结果查询明细页面弹出框-->
  <el-dialog
    title="清算账户资金池管理结果查询明细"
    center
    :visible.sync="open"
    width="1024px"
    :close-on-click-modal="true"
    @close="closeFn"
  >
    <el-form ref="detailsForm" :model="formData" label-width="170px">
      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>基本信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易流水号：" prop="id">
              <el-input v-model="formData.id" placeholder="交易流水号" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报文标识号：" prop="pkgId">
              <el-input v-model="formData.pkgId" placeholder="报文标识号" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="CPG日期：" prop="vdate">
              <el-date-picker
                disabled
                v-model="formData.vdate"
                type="date"
                value-format="yyyyMMdd"
                placeholder="选择日期"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="工作日期：" prop="workDate">
              <el-date-picker
                disabled
                v-model="formData.workDate"
                type="date"
                value-format="yyyyMMdd"
                placeholder="选择日期"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="法人机构清算行行号：" prop="lpStBrno">
              <el-input v-model="formData.lpStBrno" placeholder="法人机构清算行行号" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="法人机构清算行行名：" prop="lpStBrnoName">
              <el-input v-model="formData.lpStBrnoName" placeholder="法人机构清算行行名" disabled />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="管理类型：" prop="fpMngType">
              <el-select style="width: 100%" v-model="formData.fpMngType" placeholder="请选择" disabled>
                <el-option
                  v-for="dict in dictMap.FP_MNG_TYPE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="分支机构数目：" prop="branchNum">
              <el-input v-model="formData.branchNum" placeholder="分支机构数目" disabled />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
    </el-form>
    <el-card class="form-card" v-if="formData.fpMngType == 'MT00'">
      <ht-table
        ref="formTable"
        :dictMap="dictMap"
        :multi-select="false"
        :initData="false"
        :queryParams="queryParamsDetail"
        :reqConfig="regConfigDetail"
        :showSerialNumber="false"
        :tableBindColumns="tableBindColumnsDetail"
        defaultEventKey="detailsTable"
      ></ht-table>
    </el-card>

    <el-form ref="detailsForm" :model="formData" label-width="170px">
      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>行内处理状态</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="业务状态：" prop="txnStatus">
              <el-select style="width: 100%" v-model="formData.txnStatus" placeholder="请选择" disabled>
                <el-option
                  v-for="dict in dictMap.TXN_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="通讯状态：" prop="status">
              <el-select style="width: 100%" v-model="formData.status" placeholder="请选择" disabled>
                <el-option
                  v-for="dict in dictMap.PKG_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="中心状态：" prop="procStatus">
              <el-select style="width: 100%" v-model="formData.procStatus" placeholder="请选择" disabled>
                <el-option
                  v-for="dict in dictMap.PROCESSSTATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="录入操作员：" prop="mdTlrno">
              <el-input v-model="formData.mdTlrno" placeholder="录入操作员" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="录入时间：" prop="mdTime">
              <el-date-picker
                disabled
                v-model="formData.mdTime"
                type="datetime"
                value-format="yyyyMMddHHmmss"
                placeholder="选择时间"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="审核操作员：" prop="audTlrno">
              <el-input v-model="formData.audTlrno" placeholder="审核操作员" disabled />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="审核时间：" prop="audTime">
              <el-date-picker
                disabled
                v-model="formData.audTime"
                type="datetime"
                value-format="yyyyMMddHHmmss"
                placeholder="选择时间"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="报文发送时间：" prop="sndTime">
              <el-date-picker
                disabled
                v-model="formData.sndTime"
                type="datetime"
                value-format="yyyyMMddHHmmss"
                placeholder="选择时间"
                style="width: 100%"
              ></el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="通用报文处理码：" prop="procCode">
              <el-select style="width: 100%" v-model="formData.procCode" placeholder="请选择" disabled>
                <el-option
                  :key="formData.procCode"
                  :label="`${formData.procCode ? formData.procCode : ''}${formData.procCodeDesc ? '-' + formData.procCodeDesc : ''}`"
                  :value="formData.procCode"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="24">
            <el-form-item label="审核附言：" prop="txnRemarks">
              <el-input
                disabled
                type="textarea"
                v-model="formData.txnRemarks"
                placeholder="审核附言"
                maxlength="128"
                show-word-limit
              />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>
    </el-form>
    <div slot="footer" class="dialog-footer"></div>
  </el-dialog>
</template>
<script>
import { searchTableapl } from "@/api/cnaps/saps/clearAcctPooling/clear_fundpool_query.js";
import { log } from "util";
export default {
  name: "QueryDetails",
  components: {},
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
    formData: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      regConfigDetail: searchTableapl,
      queryParamsDetail: {
        id: "",
      },
      tableBindColumnsDetail: [
        { label: `分支机构清算行行号`, prop: "branchStBrno", align: "center", sortable: false },
        { label: `分支机构清算行行名`, prop: "branchStBrnoName", align: "center", sortable: false },
      ],
      // 是否显示弹出层
      open: false,
      isLoading: false,
    };
  },
  watch: {
    open(val) {
      if (val) {
        if (this.formData.fpMngType == "MT00") {
          this.$set(this.queryParamsDetail, "id", this.formData.id);
          this.$nextTick(() => {
            this.$refs.formTable.doQuery();
          });
        }
      }
    },
  },
  mounted() {},
  methods: {
    // 表单重置
    reset() {
      this.resetForm("detailsForm");
      // this.$set(this, "form", {});
    },
    closeFn() {
      this.open = false;
      this.reset();
    },
    show() {
      this.open = true;
    },
  },
};
</script>
<style lang="scss" scoped>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
